// @ts-ignore
/* eslint-disable */
import request from '@/request'

/** 获取登录用户 GET /user/getLoginUser */
export async function getLoginUser(options?: { [key: string]: any }) {
  return request<API.BaseResponseUserVO>('/user/getLoginUser', {
    method: 'GET',
    ...(options || {})
  })
}

/** 查询所有用户 GET /user/list */
export async function list(options?: { [key: string]: any }) {
  return request<API.BaseResponseListUser>('/user/list', {
    method: 'GET',
    ...(options || {})
  })
}

/** 用户登录 POST /user/login */
export async function login(body: API.User, options?: { [key: string]: any }) {
  return request<API.BaseResponseUser>('/user/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}

/** 退出登录 DELETE /user/logout */
export async function logout(options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/user/logout', {
    method: 'DELETE',
    ...(options || {})
  })
}

/** 注册用户 POST /user/register */
export async function save(body: API.User, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/user/register', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}

/** 根据主键更新用户 PUT /user/update */
export async function update(body: API.User, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/user/update', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}
